const search = function (location, keyword) {
  return new Promise((resolve, reject) => {
    const options = {
      complete: resolve,
      error: reject,
      autoExtend: true,
      pageIndex: 0,
      pageCapacity: 10
    }

    var searchService = new qq.maps.SearchService(options)

    // 根据输入的城市设置搜索范围
    searchService.setLocation(location)
    // 根据输入的关键字在搜索范围内检索
    searchService.search(keyword)
  })
}

export {
  search
}
